#ifndef _DEBUG_H
#define _DEBUG_H

#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <QDebug>

//#define RELEASE

#ifndef RELEASE
#define DBG_QS(args...) \
        print_error_qs( __FILE__, __FUNCTION__ , __LINE__, ##args )
#else
#define DBG(args ...)
#endif

#ifndef RELEASE
#define DBG(args...) \
        print_error( __FILE__, __FUNCTION__ , __LINE__, ##args )
#else
#define DBG(args ...) 
#endif
#ifdef __cplusplus
extern "C"
{
#endif
void print_error(const char* file,const char* function, int line, const char *fmt, ...);
void print_error_qs(const char* file,const char* function, int line, const QString fmt);
void hex_dump( unsigned char * buf, int len );
void debug_term_on();
void debug_term_off();
void debug_file_on();
void debug_file_off();
void debug_set_dir(char* str);
#ifdef __cplusplus
}
#endif
#endif //_DEBUG_H

